package 一维数组;

public class Demo6 {
    public static void main(String[] args) {
        int[] arr=new int [3];
        arr[0]=10;
        arr[1]=20;
        arr[2]=30;
        System.out.print("改变之前的数据：");
        for (int i = 0; i < arr.length; i++){
            System.out.print(arr[i]+" ");
        }
        int [] arr2=arr;
        arr2[0]=100;
        arr2[1]=200;
        arr2[2]=300;
        System.out.println();
        System.out.print("改变之后的数据为：");
        for (int i = 0; i < arr2.length; i++){
            System.out.print(arr2[i]+" ");
        }
    }
}
